home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Urgent: pow() in TurboC
- Date: 17 Mar 1996 08:38 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <17MAR199608381753@erich.triumf.ca>
- References: <4igsu5$q1t@hatathli.csulb.edu>
- NNTP-Posting-Host: erich.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4igsu5$q1t@hatathli.csulb.edu>, davidcho@csulb.edu (David Cho) writes...
-
- >void main() {
- The C standard requires main() to return an int (despite many books to the
- contrary). If you declare main() to return void, the results are undefined,
- although your program will work on many systems.... (but it's not your problem)
-
- >
- >long int k;
- >
- > k = pow(2,23);
-
- Did you #include <math.h>?
-
- If you don't include the appropriate headers, the compiler will assume that
- pow() returns an int, and will try to convert the assumed int to a long.
- Unfortunately, pow() returns a double....
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-